<template>

	<div>
		<div style="margin-top: 15px;">
			<!-- <el-input placeholder="请输入病历号" v-model="tableData.registid" class="input-with-select" clearable>
				<el-button slot="append" icon="el-icon-search" @click="selectById()"></el-button>
			</el-input> -->
			<!-- <el-input placeholder="请输入姓名" v-model="tableData.realname" class="input-with-select"
				style="margin-top:15px;" clearable>
				<el-button slot="append" icon="el-icon-search" @click="selectById()"></el-button>
			</el-input> -->
			<el-input placeholder="请输入项目类别" v-model="tableData.itemtype" class="input-with-select"
				style="margin-top:15px;" clearable>
				<el-button slot="append" icon="el-icon-search" @click="selectById()"></el-button>
			</el-input>
		</div>
		
		
					
	

		<el-table :data="tableData" stripe highlight-current-row style="width: 110%; margin-top: 15px;">
			<el-table-column prop="id" label="id" sortable fixed=true>
			</el-table-column>
			<el-table-column prop="registid" label="挂号ID" sortable>
			</el-table-column>
			<el-table-column prop="invoiceid" label="发票ID" sortable>
			</el-table-column>
			<el-table-column prop="itemid" label="项目ID" sortable>
			</el-table-column>
			<el-table-column prop="itemtype" label="项目类型" sortable>
				<template slot-scope="scope">
					<el-tag size="medium" type="primary" v-if="scope.row.itemtype===1 ">检查</el-tag>
					<el-tag size="medium" type="success" v-else-if="scope.row.itemtype===2">检验</el-tag>
					<el-tag size="medium" type="warning" v-else-if="scope.row.itemtype===3">处置</el-tag>
					<el-tag size="medium" type="info" v-else>其他</el-tag>
				</template>
			</el-table-column>
			<el-table-column prop="name" label="项目名称" sortable fixed=true>
			</el-table-column>
			<el-table-column prop="price" label="项目单价" sortable>
			</el-table-column>
			<el-table-column prop="amount" label="数量" sortable>
			</el-table-column>
			<el-table-column prop="deptid" label="执行科室ID" sortable>
			</el-table-column>
			<el-table-column prop="createtime" label="开立时间" sortable>
			</el-table-column>
			<el-table-column prop="createoperid" label="开立人员ID" sortable>
			</el-table-column>
			<el-table-column prop="paytime" label="收/退费时间" sortable>
			</el-table-column>
			<el-table-column prop="registerid" label="收/退费人员ID" sortable>
			</el-table-column>
			<el-table-column prop="feetype" label="收费方式" sortable>
				<template slot-scope="scope">
					<el-tag size="medium" type="danger" v-if="scope.row.feetype===51">现金</el-tag>
					<el-tag size="medium" type="warning" v-else-if="scope.row.feetype===52">银行卡</el-tag>
					<el-tag size="medium" type="warning" v-else-if="scope.row.feetype===53">银行卡</el-tag>
					<el-tag size="medium" type="success" v-else-if="scope.row.feetype===55">微信</el-tag>
					<el-tag size="medium" type="primary" v-else-if="scope.row.feetype===56">支付宝</el-tag>
					<el-tag size="medium" type="info" v-else>其他</el-tag>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>


<script>
	export default {
		name: "ExpenseSearch",
		data() {
			return {
				tableData: {
					id: '',
					registid: '',
					invoiceid: '',
					itemid: '',
					itemtype: '',
					name: '',
					price: '',
					amount: '',
					deptid: '',
					createtime: '',
					createoperid: '',
					paytime: '',
					registerid: '',
					feetype: '',
				}
			}
		},
		created() {
			let url = '/patientcosts/selectAll'
			this.$axios.post(url)
				.then((resp) => {
					this.tableData = resp.data;
					console.log(this.tableData)
				})
		},
		methods: {
			selectById() {
				let url = '/patientcosts/selectById'
				let param = this.$qs.stringify(this.tableData);
				this.$axios.post(url, param)
					.then((resp) => {
						this.tableData = resp.data;
						console.log(this.tableData)
					})
			}
			
		}
	}
</script>

<style scoped>

</style>
